<?php

/*
 * litchicms
 * Copyright (C) ${date} Author: tiefa(539247@qq.com)
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
!defined('BRK') && exit("!");

$conf = array(
    'serial' => 2,
    'name' => 'id',
    'title' => 'ID',
    'desc' => '必用组件',
    'group' => array(0, 'hidden'),
    'ui' => TRUE, //是否有表单控件输出
    'global' => TRUE, //是否写在页前,不论任何操作都将使用
    'buildField' => TRUE, //是否使用自己的函数组装入库的内容
    'buildUiParam' => FALSE, //是否使用自己的函数组装表单
    'columns' => array(
        'id' => array('type' => 'int', 'length' => 10, 'not null' => TRUE, 'auto_increment' => TRUE, 'PRIMARY KEY' => TRUE),
        'status' => array('type' => 'tinyint', 'length' => 1, 'not null' => TRUE, 'default' => "0" ,'KEY'=>'status'),
        'top' => array('type' => 'tinyint', 'length' => 1, 'not null' => TRUE, 'default' => "0",'KEY'=>'top'),
        'sort' => array('type' => 'int', 'length' => 10, 'not null' => TRUE, 'default' => "0",'KEY'=>'sort'),
    ),
    'columnsDescription' => array(
        'id' => '数据集文章id',
        'status' => '状态,是否被禁用',
        'top' => '是否置顶',
        'sort' => '排序,倒序',
    ),
    'show' => array(
        'top' => array(
            'serial' => 1,
            array('serial' => 1, 'text' => '内容列表', 'action' => 'list'),
            array('serial' => 2, 'text' => '添加/编辑', 'action' => 'edit'),
            array('serial' => 3, 'text' => '回收站', 'action' => 'recycle')
        ),
        'listhead' => array(
            'serial' => 1,
            array('serial' => 1, 'width' => '5%', 'text' => ''),
            array('serial' => 2, 'width' => '5%', 'text' => 'ID'),
            array('serial' => 3, 'width' => '5%', 'text' => '排序'),
            array('serial' => 100, 'width' => '10%', 'text' => '操作'),
        ),
        'listbody' => array(
            'serial' => 1,
            array('serial' => 1, 'text' => '<input type="checkbox" name="field[coll_selected][]" value="{$COLL_row["id"]}" />'),
            array('serial' => 2, 'text' => '{$COLL_row["id"]}{if $COLL_row["top"]}<sup><span class="id_top">顶</span></sup>{/if}'),
            array('serial' => 3, 'text' => '<input class="small_text_input" name="Component_options[id][{$COLL_row["id"]}]" value="{$COLL_row["sort"]}"/>'),
            array('serial' => 2, 'text' => '<div class="data_one_row"><a href="?{$COLL_row["id"]|bgpre:"collac-edit/dataid-".this}">编辑</a>&nbsp;<a href="?{$COLL_row["id"]|bgpre:"collac-del/dataid-".this}" onclick="if(!confirm(\'你确定要?\n\n\n\n\n\n\n\n删除后\n不可以恢复哦\')){return false}">删除</a>&nbsp;{if $_POST["action"]=="recycle"}<a href="?{$COLL_row["id"]|bgpre:"collac-tolist/dataid-".this}">列表</a>{else}<a href="?{$COLL_row["id"]|bgpre:"collac-torecycle/dataid-".this}">回收站</a>{/if}</div>'),
        ),
        'bottom' => array(
            'serial' => 1,
            array('serial' => 10, 'text' => '更新排序', 'onclick' => 'id_check_box_sort()', 'mustselect'=>FALSE),

            array('serial' => 1, 'text' => '全/清', 'onclick' => 'id_check_box_select_all()'),
            array('serial' => 2, 'text' => '反选', 'onclick' => 'id_check_box_swop()'),
            array('serial' => 8, 'text' => '{if $_POST["action"]=="recycle"}提至列表{else}回收站{/if}', 'onclick' => '{if $_POST["action"]=="recycle"}id_check_box_tolist(){else}id_check_box_torecycle(){/if}'),
            array('serial' => 4, 'text' => '删除', 'onclick' => 'id_check_box_del()'),
            array('serial' => 10, 'text' => '置顶/撤销', 'onclick' => 'id_check_box_top()'),

        ),
    )
);
